/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Core.impl;

import EA_Model.IEC61970.Core.BasePower;
import EA_Model.IEC61970.Core.CorePackage;

import EA_Model.IEC61970.Domain.ApparentPower;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Base Power</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Core.impl.BasePowerImpl#getBasePower <em>Base Power</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BasePowerImpl extends IdentifiedObjectImpl implements BasePower {
	/**
	 * The cached value of the '{@link #getBasePower() <em>Base Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBasePower()
	 * @generated
	 * @ordered
	 */
	protected ApparentPower basePower;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BasePowerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CorePackage.Literals.BASE_POWER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ApparentPower getBasePower() {
		if (basePower != null && basePower.eIsProxy()) {
			InternalEObject oldBasePower = (InternalEObject)basePower;
			basePower = (ApparentPower)eResolveProxy(oldBasePower);
			if (basePower != oldBasePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CorePackage.BASE_POWER__BASE_POWER, oldBasePower, basePower));
			}
		}
		return basePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ApparentPower basicGetBasePower() {
		return basePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBasePower(ApparentPower newBasePower) {
		ApparentPower oldBasePower = basePower;
		basePower = newBasePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.BASE_POWER__BASE_POWER, oldBasePower, basePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CorePackage.BASE_POWER__BASE_POWER:
				if (resolve) return getBasePower();
				return basicGetBasePower();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CorePackage.BASE_POWER__BASE_POWER:
				setBasePower((ApparentPower)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CorePackage.BASE_POWER__BASE_POWER:
				setBasePower((ApparentPower)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CorePackage.BASE_POWER__BASE_POWER:
				return basePower != null;
		}
		return super.eIsSet(featureID);
	}

} //BasePowerImpl
